﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using IQKS.AWP.DataAccessLayer;
using IQKS.AWP.BusinessObject;


namespace IQKS.AWP.BusinessAccessLayer
{
    public class UserMasterBAL
    {
       
        public DataSet GetCandidateRemaining(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetCandidateRemaining(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }
        public DataSet GetUserMaster(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetUserMaster(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public DataSet GetUserNameByRole(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetUserNameByRole(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetCandidateDetails(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetCandidateDetails(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetCandidatedetailReg(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetCandidatedetailReg(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetStatusDashboard(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetStatusDashboard(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetDesiredAttributesDoc(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetDesiredAttributesDoc(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }
                
        public DataSet GetAssessorCalenderDashboard(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetAssessorCalenderDashboard(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }
        public DataSet GetAssessorCalenderDashboardForAdmin(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetAssessorCalenderDashboardForAdmin(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }
        public DataSet GetAssessorDaysForRd(params object[] param)
        {
            DataSet objDs;
            try
            {
                //objDs = new UserMasterDAL().GetAssessorCalenderDashboard(param);
                objDs = new UserMasterDAL().GetAssessorDaysForRd(param);
            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }



        public DataSet GetStatusDashboardbyStatusId(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetStatusDashboardbyStatusId(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }



        public DataSet GetStatusDashboardbyAssigningAssessor(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetStatusDashboardbyAssigningAssessor(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetStatusDashboardbyAllocatedAssessor(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetStatusDashboardbyAllocatedAssessor(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetAssessorByRole(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetAssessorByRole(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }
        public DataSet GetAssessorLocationFees(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetAssessorLocationFees(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetUserLogin(params object[] param)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetUserLogin(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetAssessorDaysForAdmin()
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetAssessorDaysForAdmin();

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

         public string SetDefaultPassword(Guid userguid)
        {
             string valid = new UserMasterDAL().SetDefaultPassword(userguid);
             return valid;
        }

        //public UserMasterBO GetUserMaster(params object[] param)
        //{

        //    UserMasterBO objUMBo;
        //    try
        //    {

        //        objUMBo = new UserMasterBO();
        //        DataSet objDs;
        //        objDs = new UserMasterDAL().GetUserMaster(param);
        //        if (objDs != null)
        //        {
        //            DataTable objDt = objDs.Tables[0];
        //            if (objDt != null)
        //            {
        //                objUMBo.IsActive = Convert.ToBoolean(objDt.Rows[0]["IsActive"]);
        //            }
        //            else
        //            {
        //                objUMBo = null;
        //            }
        //        }

        //    }
        //    catch (Exception exception)
        //    {
        //        throw new ApplicationException(exception.Message);
        //    }
        //    return objUMBo;
        //}


        private Guid Guid(object p)
        {
            throw new NotImplementedException();
        }

        public object SetUserMaster(UserMasterBO param)
        {
            try
            {
                return new UserMasterDAL().SetUserMaster(param);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }


        public object SetCandidateMaster(UserMasterBO objUserBO, CandidateMasterBO objCandidateMasterBO, UsersContactBO objUsersContactBO, UsersQualificationBO objUsersQualificationBO)
        {
            try
            {
                return new UserMasterDAL().SetCandidateMaster(objUserBO, objCandidateMasterBO, objUsersContactBO, objUsersQualificationBO);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }
        //Vivek patil
        public object SetCandidateMasterNew(UserMasterBO objUserBO, CandidateMasterBO objCandidateMasterBO)
        {
            try
            {
                return new UserMasterDAL().SetCandidateMasterNew(objUserBO, objCandidateMasterBO);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }

        public object EditRegisterdCandidateMaster(UserMasterBO objUserBO, CandidateMasterBO objCandidateMasterBO, UsersContactBO objUsersContactBO, UsersQualificationBO objUsersQualificationBO, Int64 cid, string uregid)
        {


            try
            {
                return new UserMasterDAL().EditRegisterdCandidateMaster(objUserBO, objCandidateMasterBO, objUsersContactBO, objUsersQualificationBO, cid, uregid);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }


        public DataSet GetCandidateDetailsByEmailID(params object[] param)
        {
            DataSet objDs;


            try
            {
                objDs = new UserMasterDAL().GetCandidateDetailsByEmailID(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetUserDetails(Guid UserID)
        {
            DataSet objDs;

            try
            {
                objDs = new UserMasterDAL().GetUserDetails(UserID);
            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public string ChangeUserStatus(Guid UserID, string Email, string Status)
        {
            string result = "";
            try
            {
                result = new UserMasterDAL().ChangeUserStatus(UserID, Email, Status);
            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return result;
        }

        public DataSet GetCandidateRegByUserId(Guid UserID)
        {
            DataSet objDs;
            try
            {
                objDs = new UserMasterDAL().GetCandidatedeRegByUserId(UserID);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public string GetActualUserName(Guid UserID)
        {
            string result = "";
            try
            {
                result = new UserMasterDAL().GetActualUserName(UserID);
            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return result;
        }

        public object UpdateAssessor(UserMasterBO param)
        {
            try
            {
                return new UserMasterDAL().UpdateAssessor(param);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }



        public DataSet GetCandidateDetailsByRegNum(string strRegNum)
        {
            DataSet objDs;

            try
            {
                objDs = new UserMasterDAL().GetCandidateDetailsByRegNum(strRegNum);

            }
            catch (Exception ex)
            {

                throw new ApplicationException(ex.Message);

            }
            return objDs;
        }

        public DataSet GetDeletedCandidate(string strEmailId, string strDeletedType)
        {
            //Usp_GetDeletedCandidate
            DataSet objDs;

            try
            {
                objDs = new UserMasterDAL().GetDeletedCandidate(strEmailId, strDeletedType);

            }
            catch (Exception ex)
            {

                throw new ApplicationException(ex.Message);

            }
            return objDs;
        }



        public object DeleteCandidateByRegNum(long candID, Guid userid, string remarkbyadmin)
        {
            object objDs;
            try
            {
                objDs = new UserMasterDAL().DeleteCandidateByRegNum(candID, userid, remarkbyadmin);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);

            }
            return objDs;
        }
        public object DeleteCandidatePhysical(string strregistrationId)
        {
            object objDs;
            try
            {
                objDs = new UserMasterDAL().DeleteCandidatePhysical(strregistrationId);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);

            }
            return objDs;
        }
        public string GetPasswordByEmail(params object[] param)
        {
            string result;

            try
            {
                result = new UserMasterDAL().GetPasswordByEmail(param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return result;
        }
        public object DeleteCandidateAllocation(string strregistrationId)
        {
            object objDs;
            try
            {
                objDs = new UserMasterDAL().DeleteCandidateAllocation(strregistrationId);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);

            }
            return objDs;
        }
        public void UpdateCandidateAssessorPayment(Guid pObjUser,int CandidateID)
        {
            try
            {
                new UserMasterDAL().UpdateCandidateAssessorPayment(pObjUser,CandidateID);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);

            }
        }
        public DataSet GetCandidateMasterNew(long canId)
        {
            DataSet objDs;

            try
            {
                objDs = new UserMasterDAL().GetCandidateMasterNew(canId);

            }
            catch (Exception ex)
            {

                throw new ApplicationException(ex.Message);

            }
            return objDs;
        }


    }
}

    